package com.heys.inter.impl;

import java.io.UnsupportedEncodingException;

import com.heys.inter.IUsb;

/**
 * implements 实现
 * extents 继承
 */
public class UsbInterface implements IUsb {

	@Override
	public byte[] read() {
		
		try {
			return "我是读功能电脑".getBytes("UTF-8");
		} catch (UnsupportedEncodingException e) {
            System.out.println(e.getMessage());
			e.printStackTrace();
        }
        return new byte[]{};
	}

	@Override
	public void writ(byte[] source) {
		try {
			System.out.println(String.format("我是写功能,source = %s", new String(source,"UTF-8")));
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
    }
   

	@Override
	public String toString() {
        System.out.println("我是电脑");
		return super.toString();
	}
    
}